//
//  Purchase.swift
//  TertiumQuidPattern
//
//  Created by mac on 2017/11/2.
//  Copyright © 2017年 RRC. All rights reserved.
//

import Foundation

//采购管理类
public class Purchase:AbstractColleague
{
//    ///采购IBM电脑
//    func buyIBMcomputer(number:Int) {
//        //访问库存
//        let stock = Stock()
//        //访问销售
//        let sale = Sale()
//        //电脑的销售情况
//        let saleStatus = sale.getSaleStatus()
//        if saleStatus > 80 {
//            print("采购IBM电脑:\(number)台")
//            stock.increase(number: number)
//        }else{
//            let buyNumber = number/2 //折半采购
//            print("采购IBM电脑:\(buyNumber)台")
//        }
//
//    }
//
//    func refuseBuyIBM() {
//        print("不再采购IBM电脑")
//    }
    

    
    //////修改后
    override init(mediator:AbstractMediator) {
        super.init(mediator: mediator)
    }
    
    ///采购IBM电脑
    func buyIBMcomputer(number:Int){
        super.mediator.execute(str: "purchase.buy", objects: number as AnyObject)
    }
    
    ///不再采购IBM电脑
    func refuseBuyIBM(){
        print("不再采购IBM电脑")
    }
    
}
